home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / mxgui203.zip / MAXDOOR.PAS < prev    next >
Pascal/Delphi Source File  |  1997-08-14  |  9KB  |  211 lines

  1. {
  2. ───────────────────────────────────────────────────────────────────────────────
  3.   ▀▀▀   ▀▀▀   ▀▀▀▀▀   ▀▀   ▀▀
  4.   ▀▀▀▀ ▀▀▀▀  ▀▀   ▀▀   ▀▀ ▀▀
  5.   ▀▀ ▀▀▀ ▀▀  ▀▀▀▀▀▀▀    ▀▀▀    ╔══ ╦═╗ ╔═╗ ╦═╗ ╦ ╦ ╦ ╔═╗ ╔═╗
  6.   ▀▀  ▀  ▀▀  ▀▀   ▀▀   ▀▀ ▀▀   ║ ╦ ╠╦╝ ╠═╣ ╠═╝ ╠═╣ ║ ║   ╚═╗
  7.   ▀▀     ▀▀  ▀▀   ▀▀  ▀▀   ▀▀  ╚═╝ ╩╚═ ╩ ╩ ╩   ╩ ╩ ╩ ╚═╝ ╚═╝
  8. ───────────────────────────────────────────────────────────────────────────────
  9.   The MAX Graphics GUI Kit is Copyright 1995-Current Larry L. Athey (LA-Soft).
  10.   Color Averaging procedures are courtesy of Sean Price (Rude Dog Software).
  11. ───────────────────────────────────────────────────────────────────────────────  }
  12.  
  13. {   Adjust your compiler directives as you see fit  }
  14. {$A+,B-,D+,E+,F+,G+,I-,L+,N-,O+,P-,Q-,R-,S-,T-,V+,X+}
  15. PROGRAM MAXDOOR;
  16.  
  17. {USES CRT, TDK_VARS, MAX_UNIT, DOORKIT1, DOORKIT2, DOORKIT3;{
  18. ^ Use this for: No Local SVGA Graphics / With Comm Routines.}
  19.  
  20. USES GENOVR, CRT, TDK_VARS, DOORKIT2, MAXUNITG;{
  21. ^ Use this for: With Local SVGA Graphics / No Comm Routines.}
  22.  
  23. {$O GUI_ICON}
  24. {$O GUI_IMAG}
  25. {$O GUI_MOUS}
  26. {$O GUI_UTIL}
  27. {$O GUI_ANSI}
  28. {$O MAXUNITG}
  29.  
  30. {$O DOORKIT1}
  31. {$O DOORKIT2}
  32. {$O DOORKIT3}
  33. {$O ANSIUNIT}
  34. {$O DIGIBORD}
  35. {$O FOSUNIT}
  36. {$O CRCUNIT}
  37. {$O ASYNC}
  38. {$O COMM}
  39. {^ All of the above declarations are only temporary unit overlay
  40.    references. These units are only overlayed during the testing
  41.    of the door in local SVGA mode. When you compile your program
  42.    with the comm routines,  remove these references by inserting
  43.    a period before the dollar sign...The only reason these units
  44.    are overlayed is to conserve memory during SVGA testing...}
  45.  
  46. {$I MAXDOOR.INC}
  47.  
  48. PROCEDURE DoorIntro;
  49. BEGIN
  50.   RipToText;
  51.   InfoText(' About This Door Program ');
  52.   Set_Color(11,0); sWriteln(''); sWriteln('');
  53.   sWriteln('This is an example door program to demonstrate the ins and outs of writing a');
  54.   sWriteln('MAX door using TDK and The MAX Graphics GUI Kit...Through the use of The MAX');
  55.   sWriteln('Graphics GUI Kit, you can write the MAX side of your door in local SVGA mode');
  56.   sWriteln('thus eliminating the need to call in from remote with MAXterm to see how the');
  57.   sWriteln('program looks and operates in MAX mode...');
  58.   sWriteln('');
  59.   sWriteln('Before this program can be compiled to run in local SVGA mode, you will need');
  60.   sWriteln('a copy of The MAX Graphics GUI Kit, and the FastGraph or FastGraph/Light kit');
  61.   sWriteln('by Ted Gruber Software...BBS Utiliteez Software/LA-Soft/MAX Graphics and Ted');
  62.   sWriteln('Gruber Software/FastGraph are in no way connected. The FastGraph kit is only');
  63.   sWriteln('a development tool that MAX Graphics was designed around...');
  64.   sWriteln('');
  65.   sWriteln('This program is intentionally running in ANSI mode right now, mainly just to');
  66.   sWriteln('demonstrate this capability to the programmer. If the programmer so chooses,');
  67.   sWriteln('they may combine ANSI with MAX Graphics in the same program...However, since');
  68.   sWriteln('The MAX Graphics GUI Kit uses primarily "Dummy Routines", the programmer may');
  69.   sWriteln('need to copy source code from other TDK units to perform certain functions..');
  70.   sWriteln(''); AnyKey;
  71. END;
  72.  
  73. PROCEDURE TextPortDemo;
  74. VAR
  75.   Ch : CHAR;
  76.   C  : BYTE;
  77. PROCEDURE SendMessage(St : STRING);
  78. BEGIN
  79.   sWriteln('');
  80.   OutTxt(10,0,St);
  81. END;
  82. BEGIN
  83.   C := 0;
  84.   PortDemo_Max;
  85.   SendMessage('This is a MAXterm Text_View_Port... ');
  86.   REPEAT
  87.     Ch := UPCASE(sReadKey);
  88.     IF Ch <> 'Q' THEN BEGIN
  89.       INC(C);
  90.       IF C = 6 THEN C := 0;
  91.       CASE C OF
  92.         0 : SendMessage('This is a MAXterm Text_View_Port... ');
  93.         1 : SendMessage('This allows you to use ANSI text in a ');
  94.         2 : SendMessage('SVGA door. So, if your door uses both ');
  95.         3 : SendMessage('ANSI and MAX, then you can cut down ');
  96.         4 : SendMessage('program overhead by sharing the same ');
  97.         5 : SendMessage('text procedures for both emulations. ');
  98.       END;
  99.     END;
  100.   UNTIL Ch = 'Q';
  101. END;
  102.  
  103. PROCEDURE MainMenu;
  104. VAR
  105.   C  : BYTE;
  106.   Ch : CHAR;
  107.   St : STRING;
  108.   F  : TEXT;
  109. BEGIN
  110.   DoorIntro;
  111.   REPEAT
  112.     ShowScreen('MAINMENU.MAX');                  {Refer to DOORKIT3.PAS      }
  113.     Ch := UPCASE(sReadKey);
  114.     CASE Ch OF
  115.       'R' : ShowTextFile('MXGUI203.DOC');        {Refer to DOORKIT3.PAS      }
  116.      {'R' : ShowTextFile('DOORKIT.DOC');         {Refer to DOORKIT3.PAS      }
  117.       'E' : BEGIN
  118.              {This case procedure demonstrates how to use entry fields in MAX}
  119.              {Graphics...The entry fields are actually handled locally within}
  120.              {MAXterm, so you want to disable all inactivity timeout checking}
  121.              {only while the remote fields are active then re-enable checking}
  122.              {after the remote sends a character to indicate they are done...}
  123.              {Another thing to make a note of is that when using remote entry}
  124.              {fields is that the user must click a button with their mouse or}
  125.              {press an ALT keypress. This is the reason that the procedure in}
  126.              {the below looks for an ASCII #24 which is an ALT-O keypress. If}
  127.              {you look at FDemo_Max, the first button is assigned to ALT-O...}
  128.  
  129.               FDemo_Max; {Internal MAX screen file, see the file MAXDOOR.INC }
  130.               DoorSys.UpdateIdle := FALSE;       {Stop inactivity checking   }
  131.               Ch := sReadKey;
  132.               DoorSys.UpdateIdle := TRUE;        {Restart inactivity checking}
  133.               IF Ch = #24 THEN BEGIN             {#24 = ALT-O for "Okay"     }
  134.                 MaxCommand('');                  {Clear The Remote Buffer    }
  135.                {MaxCommand('Get_Field_Data()');} {MAXscript  Get_Field_Data  }
  136.                 MaxCommand(#255#126#250#255);    {MAXcontrol Get_Field_Data  }
  137.                {Refer to MAX_UNIT.PAS for more information on how MaxCommand }
  138.                {works, and how remote data is obtained. Certain MAX commands }
  139.                {will return data to your program which is then written to a  }
  140.                {text file on your hard drive, specific to each node number...}
  141.               END;
  142.               IF FExist('FIELDS.' + IntToStr(DoorSys.Node)) THEN BEGIN
  143.                 C := 0;
  144.                 ASSIGN(F,'FIELDS.' + IntToStr(DoorSys.Node));
  145.                 RESET(F);
  146.                 WHILE NOT EOF(F) DO BEGIN
  147.                   INC(C);
  148.                   READLN(F,St);
  149.                   St := StripBoth(St,' ');
  150.                  {The lines of text in the text file will be stored in TDK's }
  151.                  {Insert# variables which will be converted by CvtVars when  }
  152.                  {the MAXDOOR.INC / FResults_Max procedure is called...      }
  153.                   CASE C OF
  154.                     1 : Insert1 := St; {Variable holding the name            }
  155.                     2 : Insert2 := St; {Variable holding the password        }
  156.                     3 : Insert3 := St; {Variable holding the birthdate       }
  157.                     4 : Insert4 := St; {Variable holding the voice phone #   }
  158.                     5 : Insert5 := St; {Variable holding the data phone #    }
  159.                   END;
  160.                 END;
  161.                 CLOSE(F);
  162.                 ERASE(F);
  163.                 Insert2 := AllCaps(Insert2); {Uppercase the password         }
  164.                 FResults_Max; {Display the entry field results / MAXDOOR.INC }
  165.                 sReadKey;
  166.               END;
  167.               Ch := #0;
  168.             END;
  169.       'P' : BEGIN
  170.               PDemo_Max; {Internal MAX screen file, see the file MAXDOOR.INC }
  171.               DoorSys.UpdateIdle := FALSE;       {Stop inactivity checking   }
  172.               Ch := sReadKey;
  173.               DoorSys.UpdateIdle := TRUE;        {Restart inactivity checking}
  174.               IF Ch = #31 THEN BEGIN             {#31 = ALT-S for "Select"   }
  175.                 MaxCommand('');                  {Clear The Remote Buffer    }
  176.                {MaxCommand('Get_Pick_Info()');}  {MAXscript  Get_Pick_Info   }
  177.                 MaxCommand(#255#126#247#255);    {MAXcontrol Get_Pick_Info   }
  178.               END;
  179.               IF FExist('PICKINFO.' + IntToStr(DoorSys.Node)) THEN BEGIN
  180.                 C := 0;
  181.                 ASSIGN(F,'PICKINFO.' + IntToStr(DoorSys.Node));
  182.                 RESET(F);
  183.                 WHILE NOT EOF(F) DO BEGIN
  184.                   INC(C);
  185.                   READLN(F,St);
  186.                   St := StripBoth(St,' ');
  187.                   CASE C OF
  188.                     1 : Insert1 := St; {Variable holding the picklist item # }
  189.                     2 : Insert2 := St; {Variable holding the picklist text   }
  190.                   END;
  191.                 END;
  192.                 CLOSE(F);
  193.                 ERASE(F);
  194.                 PResults_Max; {Display the picklist results with MAXDOOR.INC }
  195.                 sReadKey;
  196.               END;
  197.               Ch := #0;
  198.             END;
  199.       'T' : TextPortDemo;
  200.     END;
  201.   UNTIL Ch = 'Q';
  202. END;
  203.  
  204. BEGIN
  205.   ProgramName := 'MAXDOOR.EXE Version -9.02E+16';
  206.   ProgramDesc := 'Example MAX Door Program For TDK And MAX-GUI';
  207.   UseAd       := FALSE;
  208.   InitDoorKit;
  209.   MainMenu;
  210. END.
  211.